package com.dragon.mmochat.model.roleDeal;

import com.dragon.mmochat.model.MmochatSerial;
import com.dragon.mmochat.model.enumType.MmochatPhoneCardType;

//充值卡
public class MmochatPhoneCard {
	private static MmochatSerial serial = new MmochatSerial();
	private int id;
	private MmochatPhoneCardType type;// 充值卡类型
	private String account = null;
	private String password = null;

	public MmochatPhoneCard() {
		id = serial.addAndGetSerialId();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public MmochatPhoneCardType getType() {
		return type;
	}

	public void setType(MmochatPhoneCardType type) {
		this.type = type;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isAccountOk() {
		if (account == null || account.length() != type.getAccountLength()) {
			return false;
		}
		return true;
	}

	public boolean isPasswordOk() {
		if (password == null || password.length() != type.getPasswordLength()) {
			return false;
		}
		return true;
	}
}
